package com.example.demo;

import com.actionbarsherlock.app.SherlockFragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SecondFragment extends SherlockFragment {

	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater
				.inflate(R.layout.fragment_second, container, false);
		Button bt_second = (Button) view.findViewById(R.id.bt_second);
		bt_second.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				FragmentTransaction ft = getFragmentManager()
						.beginTransaction();
				ft.setCustomAnimations(R.animator.slide_out_left, R.animator.slide_in_right);
				FirstFragment first = new FirstFragment();
				ft.replace(R.id.container, first);
				ft.commit();
			}
		});
		return view;
	}
}
